gtkheaderbar: update the window buttons on ::hierarchy-changed instead of ::realize
authorChristoph Reiter <creiter@src.gnome.org>
Wed, 18 Nov 2015 20:21:57 +0000 (21:21 +0100)
committerChristoph Reiter <creiter@src.gnome.org>
Thu, 19 Nov 2015 20:42:53 +0000 (21:42 +0100)
commitbb34db6d351862e3fb03377f60b9a884f1104683
tree641ada21a26b6d5f644707d4b0993f9963b5ccb1
parent308aec53c686eae69adbeaf5ca234a29cfd6eefa
gtkheaderbar: update the window buttons on ::hierarchy-changed instead of ::realize

The window button setup depends on properties of the toplevel window.
Instead of updating the setup on realize, do it when the toplevel
changes.

This makes sure that when a GtkHeaderBar is added to a window
all the widgets are present and get_preferred_height() will return
the height the widget will have when finally shown. This allows
the logic in gtkwindow to select the right window size so that
the content size will match the requested default size.

https://bugzilla.gnome.org/show_bug.cgi?id=756618
gtk/gtkheaderbar.c